package com.dukun.es.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * student 实体类
 *
 * author：DK
 * date：2021/10/14
 */
@Data
@TableName("student")
@Document(indexName = "student", createIndex = true)
public class Student {

    @TableId(type = IdType.AUTO)
    @Id
    private int id;

    @Field(type = FieldType.Keyword)
    private String name;

    @Field(type = FieldType.Integer)
    private int age;
}
